from django.contrib import admin
from django.urls import path
from scheduling.view import bus,driver,dashboard,schedule,maintenance,account,captcha

urlpatterns = [
    # 管理员界面

    # 主要应用路由
    path('login/dashboard/', dashboard.dashboard, name='dashboard'),
    path('buses/',bus.bus_list, name='bus_list'),
    path('buses/add/', bus.add_bus, name='add_bus'),
    path('bus/delete/<str:bus_id>/', bus.bus_delete, name='delete_bus'),
    path('bus/edit/<str:bus_id>/', bus.bus_edit, name='edit_bus'),

    path('drivers/', driver.driver_list, name='driver_list'),
    path('drivers/add/', driver.add_driver, name='add_driver'),
    path('driver/<str:driver_id>/edit/', driver.driver_edit, name='edit_driver'),
    path('driver/delete/<str:driver_id>/', driver.driver_delete, name='delete_driver'),

    path('schedules/', schedule.schedule_list, name='schedule_list'),
    path('schedules/add/', schedule.add_schedule, name='add_schedule'),
    path('schedule/delete/<int:schedule_id>/', schedule.delete_schedule, name='delete_schedule'),

    path('maintenance/', maintenance.maintenance_list, name='maintenance_list'),
    path('maintenance/add/', maintenance.add_maintenance, name='add_maintenance'),
    path('maintenance/end/<int:record_id>/', maintenance.end_maintenance, name='end_maintenance'),
    path('maintenance/delete/<int:record_id>/', maintenance.delete_maintenance, name='delete_maintenance'),
    path('login/',account.login_view,name='login'),
    path('logout/',account.logout,name='logout'),
    path('captcha/', captcha.captcha_view, name='captcha'),
]